package com.daijia.data;

import java.util.Date;

import org.springside.modules.test.utils.DataUtils;

import com.daijia.entity.account.Account;
import com.daijia.entity.account.AccountDetail;

/**
 * Account data for testing
 * @author SHI
 *
 */
public class MyAccountData {
	public static final String DEFAULT_PASSWORD = "123456";
	
	public static Account getRandomAccount () {
		Account account = new Account();
		account.setId(DataUtils.randomId());
		String loginName = DataUtils.randomName("Account");
		account.setLoginName(loginName);
		account.setPassword(DEFAULT_PASSWORD);
		account.setCreateTime(new Date());
		account.setType(Account.Type.COMPANY.toString());
		System.out.println("account: " + account);
		return account;
	}
	
	public static AccountDetail getRandomAccountDetail () {
		AccountDetail detail  = new AccountDetail();
		detail.setId(DataUtils.randomId());
		//detail.setBusinessID("businessid:" + String.valueOf(DataUtils.randomId()));
		detail.setIdCard("idcard:111");
		detail.setDriveLicenseID("license:A1111");
		detail.setEmail("1@1.com");
		System.out.println("detail: " + detail);
		
		return detail;
		
	}
	
	public static Account getRandomAccountWithDetail () {
		Account acc = getRandomAccount();
		acc.setAccountDetail(getRandomAccountDetail());
		
		return acc;
	}
}
